home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / menu-methods / xdg-desktop-entry-spec-sessions < prev   
Encoding:
Text File  |  2010-01-17  |  1.5 KB  |  64 lines

  1. #!/usr/bin/install-menu
  2. # xdg desktop entry spec - sessions generation
  3. # http://www.freedesktop.org/Standards/desktop-entry-spec
  4. # Copyright 2005 - Bill Allombert
  5. # Licensed under the GNU General Public License, version 2
  6.  
  7. !include lang.h
  8. !include menu.h
  9.  
  10. compat="menu-2"
  11. outputencoding="UTF-8";
  12. outputlanguage="C";
  13.  
  14. function has_session() = shell("grep -l -e '^/usr/share/xsessions/' '/var/lib/dpkg/info/" $package ".list' 2>/dev/null");
  15.  
  16. function name() =
  17.     "Name=" title() "\n"
  18.     forall(sections_translations(),"lang",
  19.         "Name[" $lang "]=" translate($lang,title())
  20.              "\n");
  21.  
  22. function comment() =
  23.     "Comment=" $longtitle "\n"
  24.     forall(sections_translations(),"lang",
  25.         "Comment[" $lang "]=" translate($lang,$longtitle)
  26.              "\n");
  27.  
  28. function AppEntry() =
  29.     "[Desktop Entry]\n"
  30.     "Encoding=UTF-8\n"
  31.     "Type=Application\n"
  32.         name()
  33.         ifnempty($longtitle, comment())
  34.     ifnempty($generictitle, "GenericName=" $generictitle "\n")
  35.     ifnempty(icon(),"Icon=" icon() "\n")
  36.     "Exec=" $command "\n"
  37.         "\n"
  38.         "[Window Manager]\n"
  39.         "SessionManaged=true\n";
  40.  
  41. supported;
  42.  wm = AppEntry();
  43. endsupported;
  44.  
  45. startmenu = "";
  46. endmenu = "";
  47. submenutitle = "";
  48.  
  49. treewalk = "M";
  50.  
  51. genmenu = ifnempty($command,ifempty(has_session(),
  52.             "X-Debian" replacewith($basesection,"/ ","--") 
  53.             "-" tolower(replacewith($title,"/ ","__") ".desktop")));
  54.  
  55. rootsection = "";
  56.  
  57. prerun     = "rm -rf  '" prefix() "'";
  58.  
  59. removemenu = "rm -rf  '" prefix() "'";
  60.  
  61. preoutput = "";
  62.  
  63. rootprefix = "/var/lib/menu-xdg/xsessions";
  64.